package com.bw.common.adapter

import android.net.Uri
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bw.common.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class ImgAdapter : BaseQuickAdapter<String,BaseViewHolder>(R.layout.item_img) {
    override fun convert(holder: BaseViewHolder, item: String) {
        val view = holder.getView<ImageView>(R.id.ic)
        if (item == "+"){
            Glide.with(view.context).load(R.drawable.add_img).into(view)
        }else{
            Glide.with(view.context).load(Uri.parse(item)).into(view)
        }
    }
}